import {App, createApp } from 'vue'
import AppModal from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'

import store from './vuex'
import router from './router'
import installFilter from '@/utils/filters'

function useTable(app:App){
    app.use(VXETable)
}

const app = createApp(AppModal)
installFilter(app)

import i18nPlugin from '@/plugins/i18n.ts'

app.use(i18nPlugin, {
    btnDesc: {
        change: '改变'
    }
})


// // 全局定义异步组件
// import { defineAsyncComponent } from 'vue'
// const AsyncButton = defineAsyncComponent(():any=>{
//     // import('./xxx.vue')
// })

app.use(ElementPlus).use(useTable).use(router).use(store).mount('#app')
for(const [key,component] of Object.entries(ElementPlusIconsVue)){
    app.component(key, component)
}


